<extend name="Base/common"/>
<block name="body">
	<div class="span9 page_message">
		<section id="contents">
			<include file="Addons/_nav"/>
			<!--<div class="table-bar">
				<div class="search-form fr cf">
				  <div class="sleft">
					<php> $get_param[model]=$model['name']; $search_url || $search_url = addons_url($_REQUEST ['_addons'].'://'.$_REQUEST ['_controller'].'/lists', $get_param);</php>
					<php>empty($search_key) && $search_key=$model['search_key'];empty($search_key) && $search_key='title';</php>
					<input type="text" name="{$search_key}" class="search-input" value="{:I($search_key)}" placeholder="{$placeholder}">
					<a class="sch-btn" href="javascript:;" id="search" url="{$search_url}"><i class="btn-search"></i></a> </div>
				</div>
			  </div>-->
			<!-- 数据列表 -->
			<div class="data-table">

				<div class="table-striped">

					<table cellspacing="0" class="message_list">
						<thead>
						<tr>
							<th width="60%">最近回复</th>
							<th width="30%">回复时间</th>
							<th width="10%">查看消息</th>
						</tr>
						</thead>
						<!-- 列表 -->
						<tbody>
						<volist name="list_data" id="vo">
							<tr>
								<td class="user">
									<notempty name="vo[user][headimgurl]">
										<img width="50" src="{$vo.user.headimgurl}"/>
										<else/>
										<img width="50" src="__IMG__/default.png"/>
									</notempty>
									<div class="u_info">
										<notempty name="vo[user][headimgurl]">
											<p class="name">{$vo.user.nickname}</p>
											<else/>
											<p class="name">{$vo.openid}</p>
										</notempty>

										<p class="msg">{$vo.Content}</p>
									</div>
								</td>
								<td valign="top">{$vo.CreateTime|time_format}</td>
								<td valign="top">
									<a href="{:U('person',array('openid'=>$vo[openid]))}">会话详情</a>
								</td>
							</tr>
						</volist>
						</tbody>
					</table>
				</div>
			</div>
			<div class="page"> {$_page|default=''}</div>
		</section>
	</div>
</block>
<block name="script">
	<script type="text/javascript">
		$(function () {
			//搜索功能
			$("#search").click(function () {
				var url = $(this).attr('url');
				var query = $('.search-form').find('input').serialize();
				query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
				query = query.replace(/^&/g, '');
				if (url.indexOf('?') > 0) {
					url += '&' + query;
				} else {
					url += '?' + query;
				}
				if (query == '') {
					url = "{:addons_url($_REQUEST ['_addons'].'://'.$_REQUEST ['_controller'].'/lists')}";
				}
				window.location.href = url;
			});

			//回车自动提交
			$('.search-form').find('input').keyup(function (event) {
				if (event.keyCode === 13) {
					$("#search").click();
				}
			});

		})
		function set_status(id, field, val) {
			$.post("{:U('set_status')}", {id: id, field: field, val: val}, function () {
				location.reload();
			})
		}
	</script>
</block>
